import Vuex from 'vuex'
import Vue from 'vue'
Vue.use(Vuex)


var store = new Vuex.Store({
    state: {
        username: JSON.parse(localStorage.getItem('user')) || ''
    },
    mutations: {
        setLocation(state, value) {
            localStorage.setItem('user', JSON.stringify(value))
            state.username = value
        }
    }
})
export default store